﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TeamBuy.AccessService
{
    public class TeamBuyInviteService : Common.ITeamBuyInvite
    {
        public bool CreateInvite(int userID, int invitedUserID)
        {
            int createInvite;
            createInvite = TeamBuy.AccessService.AccessHelper.ExecuteCommand("insert into C_Invite(UserID, InvitedUserID) values(" + userID + "," + invitedUserID + ")");
            if (createInvite == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        public bool ActiveInvite(int userID)
        {
            int updateInvite;
            updateInvite = TeamBuy.AccessService.AccessHelper.ExecuteCommand("update C_Invite set IsActived=1 where UserID=" + userID);
            if (updateInvite == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
